//
//  DownloadView.h
//  ebook
//
//  Created by ChenNan on 16/4/20.
//  Copyright © 2016年 Moton. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "ReaderConfig.h"

@class DownloadView;
@protocol DownloadViewDelegate<NSObject>

-(void)downloadView:(DownloadView *)view downloadType:(DownloadType)downloadType;//开始下载
-(void)downloadView:(DownloadView *)view downloadCancel:(BOOL)cancel;//取消下载

@end


@interface DownloadView : UIView

@property (nonatomic,weak) id<DownloadViewDelegate> delegate;
@property (nonatomic, strong) UIButton *downloadBtn;
@property (nonatomic, strong) UIProgressView *progressView;
@property (nonatomic, strong) UIButton *cancelBtn;
@property (nonatomic, strong) UILabel *waitLabel;//等待下载中
@property (nonatomic,assign) BOOL isNight;

-(instancetype)initWithReaderConfig:(ReaderConfig *)config;
-(void)setProgressPercent:(float)percent exist:(BOOL)exist;
//显示下载按钮状态
-(void)downloadState;
//显示进度状态
-(void)progressState;
//设置选中按钮
-(void)setDownloadType:(DownloadType)type;
//显示等待状态
-(void)showWaitingStatus;


@end
